$(function(){
    var i = 0
	var callback_count = 0
    $('#send_cmd_close').click(function(){
        vText = 'cmd_kill_v2_failed_if_not_exist'
        chrome.apipe.PrintString(vText, function(ix,s){
			callback_count += 1
			$('.retval').text('回调收到的返回值:[' + ix  + ',' + s + '],回调次数(' + callback_count + ')')
			})
    })
    
    $('#send_cmd_open').click(function(){
        cmdText = 'cmd_start_v2_failed_if_exist'
        chrome.apipe.PrintString(cmdText, function(ix,s){
			callback_count += 1
			$('.retval').text('回调收到的返回值:[' + ix  + ',' + s + '],回调次数(' + callback_count + ')')
			})
    })

    // window.addEventListener(chrome.apipe.onWriteComplete,show)
    //chrome.apipe.onWriteComplete.addListener(
        //运行结果的通知接收函数
    //    function(){
    //        i += 1
    //        $('.result').text('运行了' + i)
    //    }
    //)
})